/**
 * Created by hasee on 2017/7/24.
 */

bindClick("#senddxyj",function(){
    comment.showOperationTips("您确认给全部决赛名单发送短信及邮件吗？",function(){
        $.post($().AbsUrlParse("/web/projectallocation/senddxyj"),{

        },function(data){
            if (data.state == true) {
                if (data.res.code == 40000) {
                    hint("发送邮件与短信成功");
                    var table = $('#table');
                    table.bootstrapTable('refresh');
                } else {
                    hint(data.res.msg);
                }
            } else {
                hint(data.msg);
            }
        });
    });
});

var formatter = function(value,row,index){
    return ['<a href="javascript:void(0)" class="chakan">查看</a>'].join('');
}


window.operateEvents = {
    'click .chakan':function(e,value,row,index){
        showModel("slidingmenu", function () {
            var url = $().AbsUrlParse("/web/projectallocation/queryRaterByProId?proId="+value);
            $("#table_1").bootstrapTable("refresh", {"url": url});
        });

    }

}
//决赛的导出的功能
bindClick("#exportFinal",function(){
    $.post($().AbsUrlParse("/web/projectallocation/exportFinal"),{

    },function(data){
        if (data.state == true) {
            if (data.res.code == 40000) {
                hint("导出成功");
                var a = document.createElement("a");
                a.href = $().AbsUrlParse("/excel/" + data.res.data);
                a.click();
            } else {
                hint(data.res.msg);
            }
        } else {
            hint(data.msg);
        }
    });
});